package nl.hanze.t23i.gamemodule.game;
 
 
final class position
{
 
    public position(int board[][])
    {
        this.board = new int[3][3];
        for(int i = 0; i < 3; i++)
        {
            for(int j = 0; j < 3; j++)
                this.board[i][j] = board[i][j];
 
        }
 
    }
 
    public boolean equals(Object eq)
    {
        if(!(eq instanceof position))
            return false;
        for(int i = 0; i < 3; i++)
        {
            for(int j = 0; j < 3; j++)
                if(board[i][j] != ((position)eq).board[i][j])
                    return false;
 
        }
 
        return true;
    }
 
    public int hashCode()
    {
        int hashVal = 0;
        for(int i = 0; i < 3; i++)
        {
            for(int j = 0; j < 3; j++)
                hashVal = hashVal * 4 + board[i][j];
 
        }
 
        return hashVal;
    }
 
    private int board[][];
}